package com.ltsznh.android.heartrate.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by 涛 on 2014/12/12.
 */
public class Tools {
    private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");

    public static String getId() {
        return simpleDateFormat.format(new Date()) + "" + (int) ((Math.random() + 1) * 100000);
    }

    public static String getId(Calendar calendar) {
        return simpleDateFormat.format(calendar.getTime()) + "" + (int) ((Math.random() + 1) * 100000);
    }
}
